<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale1,maximum-scale=1">
    <title>销售退货</title>
    <link rel="shortcut icon" th:href="@{/pages/logo-1.ico}" href="../static/pages/logo-1.ico"/>
    <link rel="stylesheet" href="../static/layui/css/layui.css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" href="../static/layui/css/log.css" th:href="@{/layui/css/log.css}">
    <link rel="stylesheet" href="../static/lyear/css/style.min.css" th:href="@{/lyear/css/style.min.css}">
    <link rel="stylesheet" href="../static/lyear/css/bootstrap.min.css" th:href="@{/lyear/css/bootstrap.min.css}">
    <link rel="stylesheet" href="../static/lyear/css/materialdesignicons.min.css" th:href="@{/lyear/css/materialdesignicons.min.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!--头部信息-->
    <div th:replace="common/topbar::#topbarheader"></div>
    <!--左侧导航-->
    <div th:replace="common/leftbar::#leftbaraside"></div>
    <div class="layui-body " style="background-color: rgba(233,234,234,0.85)">

        <!-- 内容主体区域 -->
        <i class=""></i> <a href="index.html" th:href="@{/login/index}" class="layui-icon layui-icon-home">首页</a>
        <span class="layui-icon">&gt;</span>
        <span class="">销售管理</span>
        <span class="">&gt;</span>
        <span class="">销售退货</span>


        <!-- 文档列表 -->

        <div class="container-fluid" >

            <div class="row" >
                <div class="col-lg-12">
                    <div class="card"style="background-color: rgba(247,248,250,0.58)">
                        <div class="card-toolbar clearfix">
                            <div class="input-group">
                                <div class="input-group-btn">
                                </div>
                            </div>
<!--                            <div class="toolbar-btn-action">-->
<!--                                <a class="btn btn-danger" href="#!"><i class="mdi mdi-window-close"></i> 批量删除</a>-->
<!--                                <a class="btn btn-primary m-r-5" href="#!"><i class="mdi mdi-plus"></i> 添加商品</a>-->
<!--                                <a class="btn btn-primary m-r-5" href="#!"><i class="mdi mdi-plus"></i>添加订单</a>-->
<!--                            </div>-->
                        </div>
                        <div class="card-body">

                            <div class="table-responsive">
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>
                                            <label class="lyear-checkbox checkbox-primary">
                                                <input type="checkbox" id="check-all"><span></span>
                                            </label>
                                        </th>
                                        <th>序号</th>
                                        <th>退货订单ID</th>
                                        <th>商品ID</th>
                                        <th>客户ID</th>
                                        <th>支付方式</th>
                                        <th>退货时间</th>
                                        <th>总金额</th>
                                        <th>数量</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="num">
                                        <tr th:each="pagexsth:${pagexsth}">
                                        <td>
                                            <label class="lyear-checkbox checkbox-primary">
                                                <input type="checkbox" name="ids[]" value="1"><span></span>
                                            </label>
                                        </td>
                                        <td></td>
                                        <td th:text="${pagexsth.id}"></td>
                                        <td th:text="${pagexsth.goodsId}"></td>
                                        <td th:text="${pagexsth.customerId}"></td>
                                        <td th:text="${pagexsth.pay}"></td>
                                        <td th:text="${pagexsth.date}"></td>
                                        <td th:text="${pagexsth.total}"></td>
                                        <td th:text="${pagexsth.count}"></td>
                                        <td>
                                            <div class="layui-btn-group" >
                                                <a class="layui-btn layui-btn-sm" href="#!" title="编辑" data-toggle="tooltip"><i class="mdi mdi-pencil">编辑</i></a>
                                                <a class="layui-btn layui-btn-sm layui-btn-danger" href="#!" id="deletexsth" th:href="@{'/sale/deleteXsth/' + ${pagexsth.id}}" title="删除" data-toggle="tooltip"><i class="mdi mdi-window-close">删除</i></a>
                                            </div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <ul class="pagination">
                                <li><a href = "/purchase/multipage?curPage=1" th:href="'/sale/salexsth?page=0'" >首页</a></li>
                                <li th:if="${pagexsth.hasPrevious()}">
                                    <a href = "/purchase/multipageDown?curPage=${currentPage}" th:href="'/sale/salexsth?page=' + ${pagexsth.previousPageable().getPageNumber()} ">上一页</a>
                                </li>
                                <li><a>第<text th:text="${(pagexsth.number)+1}"></text>页/共<text th:text="${pagexsth.totalPages}"></text>页</a></li>
                                <li th:if="${pagexsth.hasNext()}">
                                    <a href = "/purchase/multipageUp?curPage=${currentPage}" th:href="'/sale/salexsth?page=' + ${pagexsth.nextPageable().getPageNumber()}">下一页</a>
                                </li>
                                <li><a href = "/purchase/multipage?curPage=${totalPage}" th:href="'/sale/salexsth?page=' + ${(pagexsth.getTotalPages())-1}">尾页</a></a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
<!--        <input type="hidden" name="deleteXsth1" id="deleteXsth1" th:value="${deleteXsth1}"/>&lt;!&ndash;删除弹窗&ndash;&gt;-->
        <!--内容根部-->
    </div>
</div>
<script src="../static/layui/layui.js" th:src="@{/layui/layui.js}" type="text/javascript"></script>
<script src="../static/js/vue.min.js" th:src="@{/js/vue.min.js}" type="text/javascript"></script>
<script src="../static/js/jquery-3.6.3.min.js" th:src="@{/js/jquery-3.6.3.min.js}" type="text/javascript"></script>
<script th:inline="javascript">
    //Javascript代码区域
    window.onload=function() {
            // let user = [[${user}]];
            // if (user == null || user == 0) {
            //     window.location.href = "/";
            // }

        let deleteXsth1 = [[${deleteXsth1}]];
        if (deleteXsth1>0 && deleteXsth1!=null){
            layer.open({
                title: ''
                , content: '退货订单'+ deleteXsth1+'删除成功'
            });
        }else {

        }
        //序号
        // let page = $('#page').val();
        var page = [[${pagexsth.number}]]; <!--接收值-->
        let size= 5;//每页条数
        let a = page*size;
        let b = 0;
        var oTable = document.getElementById("num");
        for(let i=a;i<a+oTable.rows.length;i++){
            oTable.rows[b].cells[1].innerHTML = (i+1);
            b++;
        }
    }
</script>
</body>
</html>
